package cn.lds.healthj377.service.impl;

import cn.lds.healthj377.domain.ExamRecord;
import cn.lds.healthj377.dto.ResponseDTO;
import cn.lds.healthj377.mapper.ExamRecordMapper;
import cn.lds.healthj377.service.ExamRecordService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ExamRecordServiceImpl implements ExamRecordService {

    @Autowired
    private ExamRecordMapper examRecordMapper;

    @Override
    public ResponseDTO<List<ExamRecord>> selectExamRecordAll() {

        List<ExamRecord> examRecords = examRecordMapper.selectExamRecordAll();


        return ResponseDTO.buildSuccess(examRecords);
    }

    @Override
    public ResponseDTO<ExamRecord> selectExamRecordById(Integer id) {

        ExamRecord examRecord = examRecordMapper.selectExamRecordById(id);
        return ResponseDTO.buildSuccess(examRecord);
    }

    @Override
    public ResponseDTO addExamRecord(ExamRecord examRecord) {

        examRecordMapper.addExamRecord(examRecord);

        return ResponseDTO.buildSuccess();
    }
}
